/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.expert.entity.CustomerSolutionAndProduct;

/**
 * 客户采纳产品DAO接口
 * @author lvbo
 * @version 2013-06-20
 */
public interface CustomerSolutionAndProductDao extends CustomerSolutionAndProductDaoCustom, CrudRepository<CustomerSolutionAndProduct, Long> {
	@Query("from CustomerSolutionAndProduct where SCS_ID = ?1 AND PRODUCT_ID = ?2")
	public CustomerSolutionAndProduct findByPKId(Long cid, Long productId);
	
	@Query("from CustomerSolutionAndProduct where SCS_ID = ?1")
	public List<CustomerSolutionAndProduct> findBySolutionId(Long customerSolutionFaceId);
	
	@Query("from CustomerSolutionAndProduct where PRODUCT_ID = ?1")
	public List<CustomerSolutionAndProduct> findByProductId(Long productId);	
	
}

/**
 * DAO自定义接口
 * @author lvbo
 */
interface CustomerSolutionAndProductDaoCustom extends BaseDao<CustomerSolutionAndProduct> {

}

/**
 * DAO自定义接口实现
 * @author lvbo
 */
@Component
class CustomerSolutionAndProductDaoImpl extends BaseDaoImpl<CustomerSolutionAndProduct> implements CustomerSolutionAndProductDaoCustom {

}
